﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Animaonline;
using Animaonline.WeatherAPI;

namespace TestCase_3
{
    class Program
    {
        public static string TommorowWeather(string city)
        {
            string weatherName;
            try
            {
                WeatherData wD = WeatherAPI.GetWeather(LanguageCode.en_US, city);
                weatherName = wD.conditionTOMORROW;
                return weatherName;
            }
            catch
            {
                throw;
            }
        }
        static string CurrentWeather(string city)
        {
            string weatherName;
            try
            {
                WeatherData wD = WeatherAPI.GetWeather(LanguageCode.en_US, city);
                weatherName = wD.condition;
                return weatherName;
            }
            catch
            {
                throw;
            }
        }

        static string Day2Weather(string city)
        {
            string weatherName;
            try
            {
                WeatherData wD = WeatherAPI.GetWeather(LanguageCode.en_US, city);
                weatherName = wD.conditionDAY2;
                return weatherName;
            }
            catch
            {
                throw;
            }
        }

        static string CrDay(string city)
        {
            double weatherName= 0.0f;
            try
            {
                WeatherData wD = WeatherAPI.GetWeather(LanguageCode.en_US, city);
                weatherName = (wD.highTODAY - 32) / 1.8;
                double cel = Math.Floor(weatherName);
                string rs = Convert.ToString(cel);
                return rs;
            }
            catch
            {
                throw;
            }
        }   
 
        static void Main(string[] args)
        {
            WeatherData wD = WeatherAPI.GetWeather(LanguageCode.en_US, "Ho Chi Minh");
            string nd = wD.day_of_weekDAY2;

            string tm = TommorowWeather("Ho Chi Minh");
            Console.WriteLine("Tommorrow :{0} ",tm);

            string cn = CurrentWeather("ho chi minh");
            Console.WriteLine("Current: {0} ",cn);

            Console.WriteLine("Day 2:{0} ",Day2Weather("Ho chi minh"));

            Console.WriteLine(nd);

            Console.WriteLine(CrDay("Ho chi minh"));

            Console.ReadKey();
        }
    }
}
